﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Simple.Repository.Models.Attendance;

namespace Simple.Services.System
{
    public class ChildAttendanceModel : ModelBase
    {
        /// <summary>
        /// 幼儿id
        /// </summary>
        public Guid ChildId { get; set; }

        /// <summary>
        /// 幼儿名称
        /// </summary>
        public string? ChildName { get; set; }

        /// <summary>
        /// 学号
        /// </summary>
        public string? StudentNumber { get; set; }

        /// <summary>
        /// 应出
        /// </summary>
        public int Should { get; set; } = 0;

        /// <summary>
        /// 实际
        /// </summary>
        public int Reality { get; set; } = 0;

        /// <summary>
        /// 没有签到
        /// </summary>
        public int NoCheckIn { get; set; } = 0;

        /// <summary>
        /// 幼儿出勤记录
        /// </summary>
        public List<AttendanceRecord> AttendanceRecordList { get; set; } = new List<AttendanceRecord>();

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<Childrens, ChildAttendanceModel>()
                 .ForMember(dest => dest.ChildId, option => option.MapFrom(b => b.Id))
                 .ForMember(dest => dest.ChildName, option => option.MapFrom(b => b.Name))
                 .ForMember(dest => dest.StudentNumber, option => option.MapFrom(b => b.StudentNumber));

            profile.CreateMap<ChildAttendanceModel, Childrens>();
        }
    }

    public class ChildAttendanceDetailDto
    {
        public string? Title { get; set; }

        public string? Start { get; set; }

        public string? End { get; set; }

        public string? CssClass { get; set; }
    }

    public class StudentAttendanceModel : ModelBase
    {
        /// <summary>
        /// 学号
        /// </summary>
        public string? StudentNumber { get; set; }
        /// <summary>
        /// 学生名
        /// </summary>
        public string? ChildName { get; set; }
        /// <summary>
        /// 班级名
        /// </summary>
        public string? ClassName { get; set; }
        /// <summary>
        /// 学生入校（刷脸）
        /// </summary>
        public DateTime? InAttendanceTime { get; set; }
        /// <summary>
        /// 家长入校（刷卡）
        /// </summary>
        public DateTime? InAttendanceTime1 { get; set; }
        /// <summary>
        /// 家长出校（刷卡）
        /// </summary>
        public DateTime? OutAttendanceTime { get; set; }

    }
}
